package com.zl.smartmall.library.po;
/**
 * 维修详情
 */
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

public class MaintenacesDetail implements Serializable {

	private String repairtype;//维修方
	private String maintainer;//转给维修人
	private String beginat;//开始时间
	private String endat;//结束时间
	private String detailresult;//维修结果
	private String detailcreated_at;//录入时间
	private String operator;//录入人
	private String reference_price;//报价
	private String real_money;//实际维修费用
	private String distribute_id;


	public String getDistribute_id() {
		return distribute_id;
	}


	public void setDistribute_id(String distribute_id) {
		this.distribute_id = distribute_id;
	}


	public String getReference_price() {
		return reference_price;
	}


	public void setReference_price(String reference_price) {
		this.reference_price = reference_price;
	}

	public String getReal_money() {
		return real_money;
	}


	public void setReal_money(String real_money) {
		this.real_money = real_money;
	}


	public String getRepairtype() {
		return repairtype;
	}


	public void setRepairtype(String repairtype) {
		this.repairtype = repairtype;
	}


	public String getMaintainer() {
		return maintainer;
	}


	public void setMaintainer(String maintainer) {
		this.maintainer = maintainer;
	}


	public String getBeginat() {
		return beginat;
	}


	public void setBeginat(String beginat) {
		this.beginat = beginat;
	}


	public String getEndat() {
		return endat;
	}


	public void setEndat(String endat) {
		this.endat = endat;
	}


	public String getDetailresult() {
		return detailresult;
	}


	public void setDetailresult(String detailresult) {
		this.detailresult = detailresult;
	}


	public String getDetailcreated_at() {
		return detailcreated_at;
	}


	public void setDetailcreated_at(String detailcreated_at) {
		this.detailcreated_at = detailcreated_at;
	}


	public String getOperator() {
		return operator;
	}


	public void setOperator(String operator) {
		this.operator = operator;
	}


	public static List<MaintenacesDetail> parse(JSONArray jsonArray) throws JSONException {
		List<MaintenacesDetail> maintenacesdetails = new ArrayList<MaintenacesDetail>();
		for(int j = 0; jsonArray != null && j < jsonArray.length();j++){
			MaintenacesDetail detail = new MaintenacesDetail();
			JSONObject details = jsonArray.getJSONObject(j);
			detail.repairtype = details.getString("repair_type");
			detail.maintainer = details.getString("maintainer");
			detail.beginat = details.getString("detail_begin_at");
			detail.endat = details.getString("detail_end_at");
			detail.detailresult = details.getString("detail_result");
			detail.detailcreated_at = details.getString("detail_created_at");
			detail.operator = details.getString("operator");
			detail.reference_price = details.getString("reference_price");
			detail.real_money = details.getString("real_money");
			detail.distribute_id = details.getString("distribute_id");
			maintenacesdetails.add(detail);
		}
		return maintenacesdetails;
	}

}